package com.itheima.c01_duotai;

public class Test {

    public static void feed(Animal animal) {
        animal.eat0();

        if (animal instanceof cat) {
            cat c= (cat) animal;
            c.maotiao();
        }

    }

    public static void main(String[] args) {

        feed(new dog("旺财", 2, "公"));
        feed(new cat("小花", 1, "母"));
        feed(new pig("小猪", 1, "公"));

    }





}
